/**
 * 传非空数组
 */
import React,{useEffect, useState} from 'react';
function Test3() {
    const [name,setname] =useState("peng-ke")
    useEffect(()=>{
        setname(name.substring(0,1).toUpperCase()+name.substring(1))
    },[name])//参数1是函数，参数2是数组
    return (
        <div>
            {name}
            <button onClick={()=>{setname("study")}}>修改</button>
        </div>
    );
}

export default Test3;